get_bls_data 2: get_bls_data

get_bls_dataR Documentation

get_bls_data

Description

Recursively get jobs data from the Bureau of Labor Statistics.

Usage

get_bls_data(series_id, start_year = NULL, end_year = NULL, api_key = NULL)

Arguments

series_id

The ID of the series you want to download

start_year

The first (earliest) year for which you want data for the series_id. If NULL, will attempt to pull the earliest available data.

end_year

The last (most recent) year for which you want data for the series_id. If NULL, will pull the most recent data.

api_key

Your registred BLS API key, or NULL if you do not have a key.

Details

Recursively requests data for the given series. Starts by downloading an increment number of years ending with the user-supplied end_year, and recursively works backward to either the user-supplied start_year or the first available year, whichever is greater.

If api_key is NULL, get_bls_data() will set increment = 10, working within the 10-year limitation of the BLS API for unregistered users.

Value

A data frame containing the requested data.

See Also

bls_api


tomhopper/blscrapeRplus documentation built on Sept. 2, 2023, 12:30 p.m.